import logging

import yaml
import os

# 默认配置文件路径
DEFAULT_CONFIG_PATH = os.path.join(os.path.dirname(__file__), "config.yaml")
print(DEFAULT_CONFIG_PATH)

def load_config(config_path=DEFAULT_CONFIG_PATH):
    """
    加载 YAML 配置文件。

    :param config_path: 配置文件路径
    :return: 配置字典
    """
    if not os.path.exists(config_path):
        raise FileNotFoundError(f"配置文件未找到: {config_path}")
    with open(config_path, "r", encoding="utf-8") as file:
        config = yaml.safe_load(file)
    return config


config= load_config()